package com.teamwhole.modules.sys.entity;

import java.util.List;

import com.google.common.collect.Lists;
import com.teamwhole.core.persistence.BaseEntity;
/**
 * 角色Entity
 * @author ZGJ
 */
public class Role extends BaseEntity<Role>{

	private static final long serialVersionUID = 1L;
	
	private String     name;       // 角色名称
	private String     enname;     // 英文名称
	private String     type;       // 类型
	private String     dataScope;  // 数据范围
	private String     isSys;      // 是否是系统数据
	private String     remark;
	
	private User       user;       // 根据用户查找角色
	private List<Menu> menuList = Lists.newArrayList();	// 拥有菜单列表
	private List<Department> deptList = Lists.newArrayList(); // 按明细设置数据范围
	
	// 数据范围（1：所有数据；2：所在公司及以下数据；3：所在公司数据；4：所在部门及以下数据；5：所在部门数据；8：仅本人数据；9：按明细设置）
    public static final String DATA_SCOPE_ALL = "1";
    public static final String DATA_SCOPE_COMPANY_AND_CHILD = "2";
    public static final String DATA_SCOPE_COMPANY = "3";
    public static final String DATA_SCOPE_OFFICE_AND_CHILD = "4";
    public static final String DATA_SCOPE_OFFICE = "5";
    public static final String DATA_SCOPE_SELF = "8";
    public static final String DATA_SCOPE_CUSTOM = "9";
	
	public Role() {
		super();
		this.dataScope = DATA_SCOPE_SELF;
	}

	public Role(String id) {
		super(id);
	}
	
	public Role(User user) {
		this();
		this.user = user;
	}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDataScope() {
        return dataScope;
    }

    public void setDataScope(String dataScope) {
        this.dataScope = dataScope;
    }

    public String getIsSys() {
        return isSys;
    }

    public void setIsSys(String isSys) {
        this.isSys = isSys;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<Menu> getMenuList() {
        return menuList;
    }

    public void setMenuList(List<Menu> menuList) {
        this.menuList = menuList;
    }

    public List<Department> getDeptList() {
        return deptList;
    }

    public void setDeptList(List<Department> deptList) {
        this.deptList = deptList;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

}
